<?php    
  require(dirname(__FILE__).'/global.php');
  
  $id = $_GET['id'];
  if(!isset($id))
  {
      header("Location: index.php");
      exit();
  }
  $sql = "update talking_resource set ResVisitNum = ResVisitNum + 1 where ResID = $id";
  $db->execute($sql);
  
  $sql = "select * from talking_resource where ResID = $id";
  $resources = $db->query($sql);
  $db->close();
  $resource = $resources[0];
  
  $smarty->assign('resource',$resource);
  $smarty->display('resource.html');
  
  $log->logInfo("[URL]$visitorURL"); 
?>
